import { request } from '@umijs/max';

export async function post_save_api(Req: NoticeApi.NoticeModelDto) {
  return request<ResponseApi.ResUnifyFormat<boolean>>('/admin/z_notice/saveOrUpate', {
    method: 'POST',
    data: Req,
  });
}

export async function get_list_api(Req: NoticeApi.NoticeSearch) {
  return request<ResponseApi.ResUnifyFormat<ResponseApi.List<NoticeApi.NoticeList>>>(
    '/admin/z_notice/findPage',
    {
      method: 'POST',
      data: Req,
    },
  );
}

export async function get_model_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<NoticeApi.NoticeModelDto>>(
    `/admin/z_notice/getDetails?id=${ID}`,
    {
      method: 'GET',
    },
  );
}
export async function delete_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`/admin/z_notice/delete?id=${ID}`, {
    method: 'GET',
  });
}

export async function delete_batch_api(IDs: (string | number)[]) {
  return request<ResponseApi.ResUnifyFormat<boolean>>('/admin/z_notice/batchDelete', {
    method: 'POST',
    data: IDs,
  });
}
export async function get_files_api(ids: string) {
  return request<ResponseApi.ResUnifyFormat<any[]>>(
    `/admin/z_file/findList?ids=${ids}`,
    {
      method: 'GET',
    },
  );
}

export async function get_zubie_list_all_api() {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_dept_group/findList`, {
    method: 'POST',
  });
}